package org.jgs1904.apachepoidemo.reflection.dynamicproxy;

import java.lang.reflect.InvocationHandler;

/**
 * @author: 默苍璃
 * @date: 2024-02-20 14:48
 */
public class HelloDynamicProxy implements Hello {
    InvocationHandler handler;

    public HelloDynamicProxy(InvocationHandler handler) {
        this.handler = handler;
    }

    public void morning(String name) throws Throwable {
        handler.invoke(
                this,
                Hello.class.getMethod("morning", String.class),
                new Object[]{name});
    }

}
